Skip to content

Conversation

@promptless
Copy link
Contributor

@promptless promptless bot commented Dec 11, 2025

Added documentation for the new session balancer mode introduced in PR #19007. The session balancer maintains monotonic consistency by routing each session to the same tablet throughout its lifetime using rendezvous hashing. This prevents scenarios where a connection reads fresh data from one tablet then stale data from a higher-lag tablet. Documentation includes usage guidance and configuration details.

Trigger Events

Open this suggestion in the Promptless dashboard


Help us improve Promptless — If this suggestion missed the mark, please share quick feedback.

If you want Promptless to make further changes on this PR, feel free to leave a comment tagging Promptless (It won't show up in the user drop down but Promptless will get it!)

@netlify
Copy link

netlify bot commented Dec 11, 2025

Deploy Preview for vitess ready!

Name Link
🔨 Latest commit f207553
🔍 Latest deploy log https://app.netlify.com/projects/vitess/deploys/694175fa68e5740008896905
😎 Deploy Preview https://deploy-preview-2043--vitess.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.


The session balancer ensures that a session always reads from the same replica to maintain monotonic consistency. Without this, a connection might read a value from one tablet, then get routed to a different tablet with higher replication lag and read an older value, effectively reading "backwards in time."

The session balancer uses rendezvous hashing (also called highest random weight hashing) to route each session to the same tablet throughout its lifetime. Rendezvous hashing ensures minimal connections moving when tablets enter or leave the pool. For each session, it computes a hash weight for every available tablet using the tablet's alias and the session's unique identifier. The tablet with the highest weight is selected; as this process is deterministic, the same session always routes to the same tablet.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Promptless

Suggested change
The session balancer uses rendezvous hashing (also called highest random weight hashing) to route each session to the same tablet throughout its lifetime. Rendezvous hashing ensures minimal connections moving when tablets enter or leave the pool. For each session, it computes a hash weight for every available tablet using the tablet's alias and the session's unique identifier. The tablet with the highest weight is selected; as this process is deterministic, the same session always routes to the same tablet.
The session balancer uses rendezvous hashing (also called highest random weight hashing) to route each session to the same tablet throughout its lifetime. Rendezvous hashing ensures minimal connections move when tablets enter or leave the pool. For each session, it computes a hash weight for every available tablet using the tablet's alias and the session's unique identifier. The tablet with the highest weight is selected; as this process is deterministic, the same session always routes to the same tablet.

The session balancer uses rendezvous hashing (also called highest random weight hashing) to route each session to the same tablet throughout its lifetime. Rendezvous hashing ensures minimal connections moving when tablets enter or leave the pool. For each session, it computes a hash weight for every available tablet using the tablet's alias and the session's unique identifier. The tablet with the highest weight is selected; as this process is deterministic, the same session always routes to the same tablet.

The algorithm prefers tablets in the local cell to minimize latency. If there are no available tablets in the local cell, the balancer will route traffic to external cells as a fallback.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@Promptless

Suggested change
Note that there are still cases where the monotonic consistency guarantee can be broken. For example, if a session is currently connected to a specific tablet, and that tablet goes down or goes out of serving, the session balancer will automatically route the session to a new, healthy tablet. If the new tablet is not as up-to-date as the previous tablet, the session may observe an older value for the same read.

@promptless
Copy link
Contributor Author

promptless bot commented Dec 16, 2025

I've added new changes to address this PR review in commit f207553

@promptless promptless bot marked this pull request as ready for review December 18, 2025 16:49
@mattlord mattlord requested a review from mhamza15 January 10, 2026 06:01
@mattlord
Copy link
Member

@mhamza15 do you need any help with this one?

@promptless
Copy link
Contributor Author

promptless bot commented Jan 10, 2026

Just a reminder: If you'd like me to act on any feedback you have via Github comments, just type @Promptless in your suggestion and I'll get right on it! (I won't show up in the user dropdown, but I'll process any request that has @Promptless in the comment body.)

@mhamza15
Copy link
Collaborator

@mhamza15 do you need any help with this one?

Oops, I lost track of this, thank you for the ping! I approved but I don’t have write access to this repo, which I now remember is why I lost track of it in the first place 😅.

@mattlord
Copy link
Member

@mhamza15 do you need any help with this one?

Oops, I lost track of this, thank you for the ping! I approved but I don’t have write access to this repo, which I now remember is why I lost track of it in the first place 😅.

I added you as a writer for the repo. Can you please accept that invite and let me know if you can then merge this on your own? If not, then I will do it for now. Thanks!

@mhamza15
Copy link
Collaborator

@mhamza15 do you need any help with this one?

Oops, I lost track of this, thank you for the ping! I approved but I don’t have write access to this repo, which I now remember is why I lost track of it in the first place 😅.

I added you as a writer for the repo. Can you please accept that invite and let me know if you can then merge this on your own? If not, then I will do it for now. Thanks!

Looks like that didn't work 😞

@mattlord mattlord merged commit bc22520 into prod Jan 13, 2026
5 checks passed
@mattlord mattlord deleted the promptless/document-session-balancer branch January 13, 2026 02:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants